﻿using System;
using System.Diagnostics;
using System.Reflection;
using System.Text;

namespace GcTicket.Model
{
    [Serializable]
    [DebuggerStepThrough]
    public abstract class EntityBase : IEntity
    {
        public virtual int Id { get; set; }

        public override string ToString()
        {
            Type t = this.GetType();
            StringBuilder sb = new StringBuilder();
            foreach (PropertyInfo pInfo in t.GetProperties())
                sb.AppendFormat("{0}={1},", pInfo.Name, pInfo.GetValue(this, null));
            return sb.ToString().Trim(',');
        }
    }
}
